package com.nobug.controller.user;

import com.nobug.bean.BaseListData;
import com.nobug.bean.BaseRespVo;
import com.nobug.service.user.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("admin/")
public class UserController {

    @Autowired
    UserService userService;

    @RequestMapping("user/list")
    public BaseRespVo userList(Integer page, Integer limit, String username, String mobile, String sort, String order){
        BaseListData data = userService.queryUsers(page,limit,username,mobile,sort,order);
        return BaseRespVo.ok(data);
    }
    @RequestMapping("address/list")
    public BaseRespVo addressList(Integer page, Integer limit, Integer userId, String name, String sort, String order){
        BaseListData data = userService.queryAddresses(page,limit,userId,name,sort,order);
        return BaseRespVo.ok(data);
    }
    @RequestMapping("collect/list")
    public BaseRespVo collectList(Integer page, Integer limit, Integer userId, Integer valueId, String sort, String order){
        BaseListData data = userService.queryCollect(page,limit,userId,valueId,sort,order);
        return BaseRespVo.ok(data);
    }
    @RequestMapping("footprint/list")
    public BaseRespVo footprintList(Integer page, Integer limit, Integer userId, Integer goodsId, String sort, String order){
        BaseListData data = userService.queryFootprint(page,limit,userId,goodsId,sort,order);
        return BaseRespVo.ok(data);
    }
    @RequestMapping("history/list")
    public BaseRespVo historyList(Integer page, Integer limit, Integer userId, String keyword, String sort, String order){
        BaseListData data = userService.queryHistory(page,limit,userId,keyword,sort,order);
        return BaseRespVo.ok(data);
    }
    @RequestMapping("feedback/list")
    public BaseRespVo feedbackList(Integer page, Integer limit, String username, Integer id, String sort, String order){
        BaseListData data = userService.queryFeedback(page,limit,username,id,sort,order);
        return BaseRespVo.ok(data);
    }

}
